import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MainComponent } from './main.component';
import { UserComponent } from './page/user/user.component';
import { UserInfoComponent } from './page/user/userInfo.component';
import { NewsComponent } from './page/news/news.component';
import { NewsInfoComponent } from './page/news/newsInfo.component';
import { NewsEditComponent } from './page/news/newsEdit.component';
import { MguserComponent } from './page/manageUser/mguser.component';
import { MguserInfoComponent } from './page/manageUser/mguserInfo.component';
import { MguserEditComponent } from './page/manageUser/mguserEdit.component';
import { PushMessageComponent } from './page/pushMessage/pushMsg.component';
import { CircleFriendComponent } from './page/circleFriend/circleFriend.component';
import { CapitalComponent } from './page/capital/capital.component';


const mainRoutes: Routes = [
    {
        path: "main",
        component: MainComponent,
        children: [
            { path: '', component: UserComponent },
            { path: 'user', component: UserComponent },
            { path: 'user/:id', component: UserInfoComponent },
            { path: 'news', component: NewsComponent },
            { path: "news/info/:id", component: NewsInfoComponent },
            { path: "news/create", component: NewsEditComponent },
            { path: "news/edit/:id", component: NewsEditComponent },
            { path: "mguser", component: MguserComponent },
            { path: "mguser/info/:id", component: MguserInfoComponent },
            { path: "mguser/create", component: MguserEditComponent },
            { path: "mguser/edit/:id", component: MguserEditComponent },
            { path: "pushmg", component: PushMessageComponent },
            { path: "circle", component: CircleFriendComponent },
            { path: "capital", component: CapitalComponent }
        ]
    }
];

@NgModule({
    imports: [
        RouterModule.forChild(mainRoutes)
    ],
    exports: [
        RouterModule
    ],
    providers: []
})
export class MainRoutingModule { }